package com.wp.admin.mapper;

import com.wp.admin.pojo.SysMenu;
import com.wp.common.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author wp
 * @create 2019-03-03 15:45
 */
public interface SysMenuMapper extends BaseMapper<SysMenu, Long> {
    @Select("select m.* from sys_menu m, sys_user u, sys_user_role ur, sys_role_menu rm where u.user_name = #{userName} and u.id = ur.user_id " +
            " and ur.role_id = rm.role_id and rm.menu_id = m.id")
    List<SysMenu> findByUserName(String userName);
}
